﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF.DAL;

namespace WF.Model
{
    /// <summary>
    /// WF_ApplyInstance实体对象
    /// </summary>
    [Serializable]
    public class WF_ApplyInstanceEntity : EntityBase<WF_ApplyInstance>
    {
        #region 构造函数

        public WF_ApplyInstanceEntity() : base() { }
        public WF_ApplyInstanceEntity(WF_ApplyInstance obj) : base(obj) { }
        #endregion

        #region 实现基类abstract属性


        public override string ID
        {
            get
            {
                return DbEntity.ApplyID;
            }
            set
            {
                DbEntity.ApplyID = value; this.SendPropertyChanged("ApplyID");
            }
        }

        public override string DisplayName
        {
            get { return DbEntity.ApplyID; }
        }

        #endregion

        #region Public 属性

        public string ApplyTypeID
        {
            get
            {
                return DbEntity.ApplyTypeID;
            }
            set
            {
                DbEntity.ApplyTypeID = value; this.SendPropertyChanged("ApplyTypeID");
            }
        }

        public string ApplyTypeName
        {
            get
            {
                return DbEntity.ApplyTypeName;
            }
            set
            {
                DbEntity.ApplyTypeName = value; this.SendPropertyChanged("ApplyTypeName");
            }
        }

        public string BizDataID
        {
            get
            {
                return DbEntity.BizDataID;
            }
            set
            {
                DbEntity.BizDataID = value; this.SendPropertyChanged("BizDataID");
            }
        }

        public string CurState
        {
            get
            {
                return DbEntity.CurState;
            }
            set
            {
                DbEntity.CurState = value; this.SendPropertyChanged("CurState");
            }
        }

        public string ApplyBy
        {
            get
            {
                return DbEntity.ApplyBy;
            }
            set
            {
                DbEntity.ApplyBy = value; this.SendPropertyChanged("ApplyBy");
            }
        }

        public string ApplicantName
        {
            get
            {
                return DbEntity.ApplicantName;
            }
            set
            {
                DbEntity.ApplicantName = value; this.SendPropertyChanged("ApplicantName");
            }
        }

        public string ApplyDeptID
        {
            get
            {
                return DbEntity.ApplyDeptID;
            }
            set
            {
                DbEntity.ApplyDeptID = value; this.SendPropertyChanged("ApplyDeptID");
            }
        }

        public System.DateTime ApplyDate
        {
            get
            {
                return DbEntity.ApplyDate;
            }
            set
            {
                DbEntity.ApplyDate = value; this.SendPropertyChanged("ApplyDate");
            }
        }

        public string K2SN
        {
            get
            {
                return DbEntity.K2SN;
            }
            set
            {
                DbEntity.K2SN = value; this.SendPropertyChanged("K2SN");
            }
        }

        public short IsWFSubmit
        {
            get
            {
                return DbEntity.IsWFSubmit;
            }
            set
            {
                DbEntity.IsWFSubmit = value; this.SendPropertyChanged("IsWFSubmit");
            }
        }

        public short IsFinished
        {
            get
            {
                return DbEntity.IsFinished;
            }
            set
            {
                DbEntity.IsFinished = value; this.SendPropertyChanged("IsFinished");
            }
        }

        public int? ProcInstID
        {
            get
            {
                return DbEntity.ProcInstID;
            }
            set
            {
                DbEntity.ProcInstID = value; this.SendPropertyChanged("ProcInstID");
            }
        }

        public decimal CurrentStepOrder
        {
            get
            {
                return DbEntity.CurrentStepOrder;
            }
            set
            {
                DbEntity.CurrentStepOrder = value; this.SendPropertyChanged("CurrentStepOrder");
            }
        }

        public string Folio
        {
            get
            {
                return DbEntity.Folio;
            }
            set
            {
                DbEntity.Folio = value; this.SendPropertyChanged("Folio");
            }
        }

        public string ApplyEmpID
        {
            get
            {
                return DbEntity.ApplyEmpID;
            }
            set
            {
                DbEntity.ApplyEmpID = value; this.SendPropertyChanged("ApplyEmpID");
            }
        }
        #endregion

        /// <summary>
        /// 从数据库对象创建逻辑对象
        /// </summary>
        /// <param name="job">数据库对象</param>
        /// <returns>逻辑对象</returns>
        [Obsolete("请使用 new WF_ApplyInstanceEntity(obj) ")]
        public static WF_ApplyInstanceEntity CreateEntityFromDb(WF_ApplyInstance obj)
        {
            if (null == obj) return null;
            WF_ApplyInstanceEntity ret = new WF_ApplyInstanceEntity(obj);
            return ret;
        }

        //#region IEntity
        //public bool Add(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Add(this);
        //}

        //public bool Update(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Update(this);
        //}

        //public bool Delete(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.DeleteApplyInstanceEntity(this.ID);
        //}

        //public bool GetDetail(WF.IDataLayer DataLayer)
        //{
        //    WF_ApplyInstanceEntity result;
        //    if (!DataLayer.GetWF_ApplyInstanceEntityById(this.ID, out result))
        //    {
        //        return false;
        //    }
        //    this._DALObject = result._DALObject;
        //    return true;
        //}
        //#endregion


    }
}
